package com.sqxgg.drugstore.email.rest;

import com.sqxgg.drugstore.email.entity.EmailEntity;
import com.sqxgg.drugstore.email.service.SendEmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/api/email")
public class SendEmailRest {
    @Autowired
    SendEmailService sendEmailService;

    @PostMapping({"/sendEmail"})
    public String sendEmail(@RequestBody EmailEntity emailEntity)
    {

     return sendEmailService.sendEmail(emailEntity);
    }

    @PostMapping({"/test"})
    public String test(@RequestBody EmailEntity emailEntity)
    {

        return "sadasd";
    }
}
